package cn.com.pajx.pajx_visitor_v3.broadcast;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

/**
 * create by ruancw on 20120/7/27
 * description
 */
public class AlarmTaskReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        String action = intent.getAction();
        assert action != null;
        if (action.equals("com.pajx.alarm.RECEIVER")) {
            if(alarmTaskListener!=null){
                alarmTaskListener.executeAlarmTask();
            }
        }
    }

    private AlarmTaskListener alarmTaskListener;

    public interface AlarmTaskListener{
        void executeAlarmTask();
    }

    public void setOnAlarmTaskListener(AlarmTaskListener alarmTaskListener){
        this.alarmTaskListener=alarmTaskListener;
    }
}
